
package com.jas.common;

import java.util.Calendar;

public class FloatingEvent extends Event{
	
	@SuppressWarnings("unused")
	private final String CLASS_NAME = this.getClass().getSimpleName(); // Used by the gson deserializer
	
	//@author a0118677r
	public FloatingEvent(String eventDescription){
		super();
		this.setEventDescription(eventDescription);
	}
	
	//@author a0118677r
		public FloatingEvent(String eventId, String eventDescription){
			super(eventId);
			this.setEventDescription(eventDescription);
		}

	//@author a0118677r
	@Override
	public Event copy(){
		Event copy = new FloatingEvent(this.getEventId(), this.getEventDescription());
		copy.setCompleted(this.isCompleted());
		return copy;
	}
	
	//@author a0118677r
	public Event convertToDeadlineEvent(Calendar endDateTime) {
		Event deadlineEvent = new DeadlineEvent(this.getEventId(), this.getEventDescription(), endDateTime);
		return deadlineEvent;
	}
	
	//@author a0118677r	
	@SuppressWarnings("rawtypes")
	@Override
	public Class getSubClass() {
		return this.getClass();
	}

	//@author a0118677r
	@Override
	public String toString() {
		String completionStatus="";
		if(isCompleted()){
			completionStatus=Language.getString("KEYWORD_YES");
		}
		else{
			completionStatus=Language.getString("KEYWORD_NO");
		}
		return String.format(Language.getString("DISPLAY_EVENT"), getEventDescription(), "", "", completionStatus, getEventId());
	}	
}
